package login;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 黎鹤舞
 * Date: 2023-11-27
 * Time: 21:09
 */

//这里是用户登录
public class Login {

    //这里是字段:
    public String userName;
    public String passWord;

    //进行简单的逻辑判断
    public void login(String userName,String passWord) {

        //如果输入的信息不匹配该类的成员信息，抛出自定义异常!(这里只抛出，不解决)
        if(!this.userName.equals(userName)) {
            throw new UserNameException("账户名输入错误!!!");
        }
        if(!this.passWord.equals(passWord)) {
            throw new PassWordException("密码输入错误!!!");
        }
    }

    //构造函数

    public Login(String userName, String passWord) {
        this.userName = userName;
        this.passWord = passWord;
    }
}
